<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>编辑个人信息</title>
	
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
		span {color:red;}
		#spanSubmit {padding-left:128px;}
		.action .pages {padding-left:256px;}
	</style>
	
	<script type="text/javascript">
		function checkNickname(nickname)
		{
			with(nickname)
			{
				if(value==null || value=="")
				{
					alert("昵称不能为空");
					focus();
					return;
				}
			}
		}
		function checkPhone(phone)
		{
			with(phone)
			{
				if(value == null || value == "")
				{
					alert("手机号码不能为空。");
					focus();
					return;
				}
				if(isNaN(value))
				{
					alert("手机号码必须都是数字。");
					focus();
					return;
				}
				if(value.length != 11)
				{
					alert("手机号码必须是11位数字");
					focus();
					return;
				}
			}
			
		}
	</script>
</head>
<body>
	<div class="action">
		<div class="t">
			编辑个人信息
		</div>
		<div class="pages">
			<form action="">
				<ul>
					<li>
						<label for="nickname">昵称：</lable>
						<input type="text" name="nickname" id="nickname" value="战神" onblur="checkNickname(this)"/>
						<span >*</span>
					</li><br/>
					<li>
						<label for="age">年龄：</label>
						<input type="text" name="age" id="age" value="2"/>
					</li><br/>
					<li>
						<label for="sex">性别：</label>
						<select id="sex">
							<option value="female">女</option>
							<option value="male" selected="selected">男</option>
						</select>
					</li><br/>
					<li>
						<label for="phone">手机：</lable>
						<input type="text" name="phone" id="phone" value="12345678910" onblur="checkPhone(this)"/>
						<span >*</span>
					</li><br/>
					<li>
						<label for="address">地址：</lable>
						<input type="text" name="address" id="address" value="北京"/>
					</li><br/>
				</ul>
				<span id="spanSubmit">
					<input type="submit" value="保存数据"/>
					<button >返回</button>
				</span>
				
			</form>	
		</div>
	</div>
</body>
</html>